<html>
 <head>
  <meta charset="utf-8"/>
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"/>
  <title>
   主题：如何把C语言代码编译为可执行的exe文件  | 数螺 | NAUT IDEA
  </title>
  <link href="http://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" rel="stylesheet"/>
  <link href="http://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/>
  <style type="text/css">
   #xmain img {
                  max-width: 100%;
                  display: block;
                  margin-top: 10px;
                  margin-bottom: 10px;
                }

                #xmain p {
                    line-height:150%;
                    font-size: 16px;
                    margin-top: 20px;
                }

                #xmain h2 {
                    font-size: 24px;
                }

                #xmain h3 {
                    font-size: 20px;
                }

                #xmain h4 {
                    font-size: 18px;
                }


                .header {
	           background-color: #0099ff;
	           color: #ffffff;
	           margin-bottom: 20px;
	        }

	        .header p {
                  margin: 0px;
                  padding: 10px 0;
                  display: inline-block;  
                  vertical-align: middle;
                  font-size: 16px;
               }

               .header a {
                 color: white;
               }

              .header img {
                 height: 25px;
              }
  </style>
  <script src="http://cdn.bootcss.com/jquery/3.0.0/jquery.min.js">
  </script>
  <script src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML" type="text/javascript">
   MathJax.Hub.Config({elements: ["bbpress-forums"]});
  </script>
  <script src="http://nautstatic-10007657.file.myqcloud.com/static/css/readability.min.js" type="text/javascript">
  </script>
  <script type="text/javascript">
   $(document).ready(function() {
                 var loc = document.location;
                 var uri = {
                  spec: "http://cos.name/cn/topic/407855/",
                  host: "http://cos.name",
                  prePath: "http://cos.name",
                  scheme: "http",
                  pathBase: "http://cos.name/"
                 };
    
                 var documentClone = document.cloneNode(true);
                 var article = new Readability(uri, documentClone).parse();
     
                 document.getElementById("xmain").innerHTML = article.content;
                });
  </script>
  <!-- 1466444503: Accept with keywords: (title(0.5):文件,代码,主题,C语言,编译,论坛, topn(0.366666666667):信息,帖子,编译,编译器,查找,会员,用法,目录,选项,文件,用户名,缺省,C语言,例子,参数,类型,调试信息,汇编程序,C++,目标,普通,头文件,代码,主题,程序,c++,逗号,论坛,时候,讨论区).-->
 </head>
 <body class="topic bbpress single single-topic postid-407855 single-author sidebar" onload="">
  <div class="header">
   <div class="container">
    <div class="row">
     <div class="col-xs-6 col-sm-6 text-left">
      <a href="/databee">
       <img src="http://nautidea-10007657.cos.myqcloud.com/logo_white.png"/>
      </a>
      <a href="/databee">
       <p>
        数螺
       </p>
      </a>
     </div>
     <div class="hidden-xs col-sm-6 text-right">
      <p>
       致力于数据科学的推广和知识传播
      </p>
     </div>
    </div>
   </div>
  </div>
  <div class="container text-center">
   <h1>
    主题：如何把C语言代码编译为可执行的exe文件
   </h1>
  </div>
  <div class="container" id="xmain">
   <div class="hfeed site" id="page">
    <header class="site-header" id="masthead" role="banner">
     <div id="cos-logo">
      <a href="http://cos.name/cn">
       <img src="http://cos.name/cn/wp-content/themes/COS-forest/images/headers/cos-logo.png"/>
      </a>
     </div>
     <div class="navbar" id="navbar">
      <nav class="navigation main-navigation" id="site-navigation" role="navigation">
       <h3 class="menu-toggle">
        菜单
       </h3>
       <div class="menu-%e8%8f%9c%e5%8d%951-container">
        <ul class="nav-menu" id="menu-%e8%8f%9c%e5%8d%951">
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-home menu-item-407772" id="menu-item-407772">
          <a href="http://cos.name/cn/">
           论坛首页
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-407773" id="menu-item-407773">
          <a href="http://cos.name/cn/forums/">
           讨论区
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-407774" id="menu-item-407774">
          <a href="http://cos.name/cn/wp-login.php?action=register">
           注册
          </a>
         </li>
         <li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-407819" id="menu-item-407819">
          <a href="http://cos.name/">
           主站
          </a>
         </li>
        </ul>
       </div>
      </nav>
      <!-- #site-navigation -->
     </div>
     <!-- #navbar -->
    </header>
    <!-- #masthead -->
    <div class="site-main" id="main">
     <div class="content-area" id="primary">
      <div class="site-content" id="content" role="main">
       <article class="post-407855 topic type-topic status-publish hentry" id="post-407855">
        <header class="entry-header">
         <h1 class="entry-title">
          如何把C语言代码编译为可执行的exe文件
         </h1>
        </header>
        <!-- .entry-header -->
        <div class="entry-content">
         <div id="bbpress-forums">
          <div class="bbp-breadcrumb">
           <p>
            <a class="bbp-breadcrumb-home" href="http://cos.name/cn/">
             COS论坛 | 统计之都
            </a>
            <span class="bbp-breadcrumb-sep">
             ›
            </span>
            <a class="bbp-breadcrumb-root" href="http://cos.name/cn/forums/">
             讨论区
            </a>
            <span class="bbp-breadcrumb-sep">
             ›
            </span>
            <a class="bbp-breadcrumb-forum" href="http://cos.name/cn/forum/software/">
             软件应用
            </a>
            <span class="bbp-breadcrumb-sep">
             ›
            </span>
            <a class="bbp-breadcrumb-forum" href="http://cos.name/cn/forum/software/r-language/">
             S-Plus &amp; R语言
            </a>
            <span class="bbp-breadcrumb-sep">
             ›
            </span>
            <span class="bbp-breadcrumb-current">
             如何把C语言代码编译为可执行的exe文件
            </span>
           </p>
          </div>
          <div class="bbp-template-notice info">
           <p class="bbp-topic-description">
            该主题包含 5 条回复，3个帖子，最后由
            <a class="bbp-author-avatar" href="http://cos.name/cn/profile/109572/" rel="nofollow" title="查看ywh19860616的档案">
             <img src="http://sdn.geekzu.org/avatar/8599115e910c111374c57034b9f33bda?s=14&amp;d=monsterid&amp;r=g"/>
            </a>
            <a class="bbp-author-name" href="http://cos.name/cn/profile/109572/" rel="nofollow" title="查看ywh19860616的档案">
             ywh19860616
            </a>
            在
            <a href="http://cos.name/cn/topic/407855/#post-407919" title="回复：如何把C语言代码编译为可执行的exe文件">
             1 年, 7 月 之前
            </a>
            更新。
           </p>
          </div>
          <div class="bbp-pagination">
           <div class="bbp-pagination-count">
            查看 6 个帖子 - 1 到 6（总计 6 个）
           </div>
           <div class="bbp-pagination-links">
           </div>
          </div>
          <ul class="forums bbp-replies" id="topic-407855-replies">
           <li class="bbp-header">
            <div class="bbp-reply-author">
             作者
            </div>
            <!-- .bbp-reply-author -->
            <div class="bbp-reply-content">
             帖子
            </div>
            <!-- .bbp-reply-content -->
           </li>
           <!-- .bbp-header -->
           <li class="bbp-body">
            <div class="bbp-reply-header" id="post-407855">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2014年11月5日 下午4:06
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/407855/#post-407855">
               1 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-407855 -->
            <div class="odd bbp-parent-forum-999 bbp-parent-topic-407855 bbp-reply-position-1 user-id-109572 topic-author post-407855 topic type-topic status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/109572/" rel="nofollow" title="查看ywh19860616的档案">
               <img src="http://sdn.geekzu.org/avatar/8599115e910c111374c57034b9f33bda?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/109572/" rel="nofollow" title="查看ywh19860616的档案">
               ywh19860616
              </a>
              <br/>
              <div class="bbp-author-role">
               普通会员
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               请教各位老师，已有了一个别人编写的c语言程序a.C，如何将它编译为exe执行文件？谢谢
               <br/>
               这个代码别人已经编译过了，所以代码应该没有问题。只是我想修改里面的参数，需要重新编译。
               <br/>
               因为论坛不支持直接上传文件，我把代码贴在下面：
              </p>
              <pre class="highlight ">#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;math.h&gt;

#define max(a,b)	a&gt;b?a:b

#define EPS             1.5

int Ndat=15000;
int Mmax=8;     /* maximum emb. dim. */
int n, K;
double T2,Q,Qad,**A,C[4],*h,*ohm,*cov;
double p_HJ, p_T2, p_HJad, HJ_TVAL, T2_TVAL;

/* determine the log of ratios of correlation integrals */

void redun(double *x, double *y, int N, int m, int mmax, double epsilon)
{

  int i, j, s;
  int IYij, IXYij, IYZij, IXYZij;
  double disx, disy, disz, *Cy, *Cxy, *Cyz, *Cxyz, tCy=0, tCxy=0, tCyz=0, tCxyz=0;

  Cy = (double *) malloc(N*sizeof(double));
  Cxy = (double *) malloc(N*sizeof(double));
  Cyz = (double *) malloc(N*sizeof(double));
  Cxyz = (double *) malloc(N*sizeof(double));
  
  for (i=0;i!=N;i++)
    h[i] = Cy[i] = Cxy[i] = Cyz[i] = Cxyz[i] = 0.0;
  
  T2=Q=0.0;

  n = N - mmax;
  
  for (i=mmax;i!=N;i++)
  {

    Cy[i]=Cxy[i]=Cyz[i]=Cxyz[i]=0.0;

    for (j=mmax;j!=N;j++)
    if (j!=i)
    {
	    
      disx = disy = 0.0;
      for (s=1;s!=m+1;s++)
        disx = max(fabs(x[i-s]-x[j-s]),disx);
      
      for (s=1;s!=mmax+1;s++)
        disy = max(fabs(y[i-s]-y[j-s]),disy);

      if (disy &lt;= epsilon)
      {
	Cy[i]++;
        A[3][i]++;

        if (disx &lt;= epsilon)
        {
          Cxy[i]++;
          A[1][i]++;
        }

        disz = max(fabs(y[i]-y[j]),disy);

        if (disz &lt;= epsilon)
        {
          Cyz[i]++;
          A[2][i]++;
          if (disx &lt;= epsilon)
          {
            Cxyz[i]++;
            A[0][i]++;
          }
        }
      }   /* end condition |Yi - Yj| &lt; epsilon */
    }   /* end loop over j */


    Cy[i] /= (double)(n);
    Cxy[i] /= (double)(n);
    Cyz[i] /= (double)(n);
    Cxyz[i] /= (double)(n);

    h[i] += 2.0*(Cxyz[i]*Cy[i] - Cxy[i]*Cyz[i])/6.0;

    for (j=mmax;j!=N;j++)
    if (j!=i)
    {
	    
      IYij = IXYij = IYZij = IXYZij = 0;
      
      disx = disy = 0.0;

      for (s=1;s!=m+1;s++)
        disx = max(fabs(x[i-s]-x[j-s]),disx);
     
      for (s=1;s!=mmax+1;s++)
        disy = max(fabs(y[i-s]-y[j-s]),disy);

      if (disy &lt;= epsilon)
      {
        IYij=1;
        if (disx &lt;= epsilon)
        {
	  IXYij = 1;
        }

        disz = max(fabs(y[i]-y[j]),disy);

        if (disz &lt;= epsilon)
        {
	  IYZij = 1;	
        if (disx &lt;= epsilon)
            IXYZij = 1;
        }
      }   /* end condition |Yi - Yj| &lt; epsilon */

      h[j] += 2.0*(Cy[i]*IXYZij - Cyz[i]*IXYij)/(double)(6*n);
      h[j] += 2.0*(Cxyz[i]*IYij - Cxy[i]*IYZij)/(double)(6*n);
       
    }   /* end second loop over j */

    tCy+=n*Cy[i]; tCxy+=n*Cxy[i], tCyz+=n*Cyz[i], tCxyz+=n*Cxyz[i];

    T2 += Cxyz[i]*Cy[i] - Cyz[i]*Cxy[i];
     
  } /* end loop over i */

/*
 Alternatively one might determine T2 as the sum of the h[i]

  for (i=mmax;i!=N;i++)
    T2 += h[i];
*/

  T2 /= (double)(n);

  for (i=mmax;i!=N;i++)
  {
    h[i] -= T2;
  }

  Q = (double) tCxyz/tCxy - (double) tCyz/tCy; 

  C[0] = tCxyz/(double)(n*(n-1));
  C[1] = tCxy/(double)(n*(n-1));
  C[2] = tCyz/(double)(n*(n-1));
  C[3] = tCy/(double)(n*(n-1));

  Qad = C[0]*C[3] - C[1]*C[2];

  for (i=0;i!=4;i++)
   for (j=mmax;j!=N;j++)
   {
     A[i][j] /= (double)(n-1);
     A[i][j] -= C[i];
   } 

  free(Cy); free(Cxy); free(Cyz); free(Cxyz);
}

void InsertionSort(double *X, int *S, int M)
{
    int i, *I;
    int j;
    int r;
    double R;

    I= (int*) malloc (M*sizeof(int));

    for (i=0;i&lt;M;i++)
      I[i]=i;

    for (i=1; i&lt;M; i++)
      {
        R = X[i];
        r = i;
	for (j=i-1; (j&gt;=0) &amp;&amp; (X[j]&gt;R); j--)
        {
	  X[j+1] = X[j];
          I[j+1] = I[j];
        }
	X[j+1] = R;
        I[j+1] = r;
      }
    for (i=0; i&lt;M; i++)
      S[I[i]]=i;

}


void  uniform (double *X, int M)
{
  int *I, i;

  I = (int*) malloc (M*sizeof(int));
  InsertionSort(X, I, M);

  for (i=0;i&lt;M;i++)
    X[i] = (double) I[i]/M*3.464101615;        // to make unit variance

}


/* normalize the time series to unit std. dev. */

void normalise(double *x, int N)
{
  int i;
  double mean=0.0, var=0.0;

  for (i=0;i!=N;i++)
  {
    mean += x[i];
    var += x[i]*x[i];
  }

  mean /= (double)(N);
  var /= (double)(N);
  var -= mean*mean;

  for (i=0;i!=N;i++)
    x[i] = (x[i]-mean)/sqrt(var);

  return;
}

//double rand01(void)
//{
//  return ((double)(rand())/(double)(RAND_MAX));
//}

void testcaus(double *x, double *y, int N, double epsilon, int m, int U)
{

  int i, j, k, l, mmax;
  double HJad_TVAL, S2, S2ad, VT2, d[4], sigma[4][4];
  
  for (j=0;j!=4;j++)
  {
    C[j] = 0.0;
    for (i=0;i!=N;i++)
    {
      A[j][i] = 0.0;
    }
  }

  if (U&lt;=0)
  {
    normalise(x, N);
    normalise(y, N);
  }
  else
  {
    uniform(x, N);
    uniform(y, N);
  }

  redun(x,y,N,m,m,epsilon);

  mmax = m;
    
  for (i=0;i!=4;i++)
  {
    for (j=0;j!=4;j++)
    {
      sigma[i][j] = 0.0;
      for (k=0;k!=K;k++)
      {
        for (l=mmax+k;l!=N;l++)
          sigma[i][j] += 4.0*ohm[k]*(A[i][l]*A[j][l-k]+A[i][l-k]*A[j][l])/(double)(2*(n-k));
      }
    }
  }

  S2=S2ad=0.0;
    
  d[0] = 1.0/C[1];
  d[1] = -C[0]/(C[1]*C[1]);
  d[2] = -1.0/C[3];
  d[3] = C[2]/(C[3]*C[3]);

  for (i=0;i!=4;i++)
    for (j=0;j!=4;j++)
      S2 += d[i]*sigma[i][j]*d[j];

   HJ_TVAL = Q*sqrt(n)/sqrt(S2);

  d[0] = C[3];
  d[1] = -C[2];
  d[2] = -C[1];
  d[3] = C[0];

  for (i=0;i!=4;i++)
     for (j=0;j!=4;j++)
        S2ad += d[i]*sigma[i][j]*d[j];

  HJad_TVAL = Qad*sqrt(n)/sqrt(S2ad);
    
    
  /* determine autocovariance of h[i] */
    
  for (k=0;k!=K;k++)
  {
    cov[k] = 0.0;
    
    for (i=mmax+k;i!=N;i++)
      cov[k] += h[i]*h[i-k];

    cov[k] /= (double)(n-k);
  } 
    
  VT2=0.0;
    
/* variance of T2 */
	
  for (k=0;k!=K;k++)
    VT2 += 9.0*ohm[k]*cov[k];
  
  T2_TVAL = T2*sqrt(n)/sqrt(VT2);

  if (HJ_TVAL&gt;0)
     p_HJ = 0.5 - 0.5*erf(HJ_TVAL/sqrt(2.0));
  else
     p_HJ = 0.5 + 0.5*erf(-HJ_TVAL/sqrt(2.0));

  if (T2_TVAL&gt;0)
     p_T2 = 0.5 - 0.5*erf(T2_TVAL/sqrt(2.0));
  else
     p_T2 = 0.5 + 0.5*erf(-T2_TVAL/sqrt(2.0));

  if (HJad_TVAL&gt;0)
     p_HJad = 0.5 - 0.5*erf(HJad_TVAL/sqrt(2.0));
  else
     p_HJad = 0.5 + 0.5*erf(-HJad_TVAL/sqrt(2.0));

}


int main()
{
  char filename1[128], filename2[128], filename[128];
  double x[Ndat], y[Ndat], tmp, epsilon=EPS;
  int i, j, k, m, N;
//  long seed;
  FILE *infil, *outfil;

  printf("Input file 1: "); scanf("%s", filename1);

  if ( (infil=fopen(filename1,"r")) == NULL)
  {
    fprintf(stderr,"Error: unable to open file. Exiting...\n");
    exit(1);
  }

  i = 0;
  while (fscanf(infil,"%lf", &amp;tmp) != EOF)
  {
      x[i] = tmp;
      i++;
  }

  N = i;

  printf("%d data read\n", i);
  
  printf("Input file 2: "); scanf("%s", filename2);

  fclose(infil);

  if ( (infil=fopen(filename2,"r")) == NULL)
  {
    fprintf(stderr,"Error: unable to open file. Exiting...\n");
    exit(1);
  }

  i = 0;
  while (fscanf(infil,"%lf", &amp;tmp) != EOF)
  {
      y[i] = tmp;
      i++;
  }

  fclose(infil);

  printf("%d data read\n", i);

  if (i!=N)
  {
    fprintf(stderr,"Error: data number mismatch. Exiting...\n");
    exit(1);
  }

  A = (double **) malloc(4*sizeof(double *));
  for (i=0;i!=4;i++)
    A[i] = (double *) malloc(N*sizeof(double));

  
  h = (double *) malloc(N*sizeof(double));
  
  K = (int)(sqrt(sqrt(N)));
  ohm = (double *) malloc(K*sizeof(double));
  cov = (double *) malloc(K*sizeof(double));

  ohm[0] = 1.0;
  for (k=1;k&lt;K;k++)
    ohm[k] = 2.0*(1.0-k/(double)(K));

  /* Generate output file name */

  //Generate output file name
  i=0;

  while (filename1[i]!='' &amp;&amp; filename1[i]!='.')
  {
    filename[i]=filename1[i];
    i++;
  }
  filename1[i]='';
  filename[i]='_';

  j=0;

  while (filename2[j]!='' &amp;&amp; filename2[j]!='.')
  {
    filename[i+j+1]=filename2[j];
    j++;
  }

  filename2[j]='';
  filename[i+j+1]='.';  filename[i+j+2]='o'; filename[i+j+3]='u'; 
  filename[i+j+4]='t'; filename[i+j+5]='';


  if ( (outfil=fopen(filename,"w")) == NULL)
  {
    fprintf(stderr,"Error: unable to open file for writing.\
	Exiting...\n");
    exit(1);
  }

  fprintf(outfil,"file 1: %s\n", filename1);
  fprintf(outfil,"file 2: %s\n", filename2);
  fprintf(outfil,"series length: %d\n",N);
  fprintf(outfil,"epsilon=%f\n",epsilon);


  A = (double **) malloc(4*sizeof(double *));
  for (i=0;i!=4;i++)
   A[i] = (double *) malloc(N*sizeof(double));

  h = (double *) malloc(N*sizeof(double));
  
 // printf("seed: "); scanf("%ld",&amp;seed);
 // srand(seed);


  fprintf(stderr,"epsilon=%f\n",epsilon);
  fprintf(outfil,"epsilon=%f\n",epsilon);
  /* fprintf(stderr,"       T2        TVAL       p           Q       TVAL      p          Qad      TVAL      p \n");
  */

  fprintf(stderr,"\n%s does not granger cause %s\n", filename1, filename2);
  fprintf(outfil,"\n%s does not granger cause %s\n", filename1, filename2);
  
  for (m=1;m&lt;=Mmax;m++)
  { testcaus(x,y,N,epsilon,m,0);

    fprintf(stderr,"lX=lY=%d, p_HJ=%1.6f T_HJ=%1.6f p_T2=%1.6f T_T2=%1.6f\n",m,\
		    p_HJ, HJ_TVAL, p_T2, T2_TVAL);
    fprintf(outfil,"lX=lY=%d, p_HJ=%1.6f T_HJ=%1.6f p_T2=%1.6f  T_T2=%1.6f\n",m,\
		    p_HJ, HJ_TVAL, p_T2, T2_TVAL);
  }
  fprintf(stderr,"\n%s does not granger cause %s\n", filename2, filename1);
  fprintf(outfil,"\n%s does not granger cause %s\n", filename2, filename1);

  for (m=1;m&lt;=Mmax;m++)
  {
    testcaus(y,x,N,epsilon,m,0);

    fprintf(stderr,"lX=lY=%d, p_HJ=%1.6f T_HJ=%1.6f p_T2=%1.6f T_T2=%1.6f\n",m,\
		    p_HJ, HJ_TVAL, p_T2, T2_TVAL);
    fprintf(outfil,"lX=lY=%d, p_HJ=%1.6f T_HJ=%1.6f p_T2=%1.6f  T_T2=%1.6f\n",m,\
		    p_HJ, HJ_TVAL, p_T2, T2_TVAL);
  }

  fprintf(stderr,"\n%s does not granger cause %s (UNIF)\n", filename1, 
filename2);
  fprintf(outfil,"\n%s does not granger cause %s (UNIF)\n", filename1, 
filename2);

  for (m=1;m&lt;=Mmax;m++)
  {
    testcaus(x,y,N,epsilon,m,1);

    fprintf(stderr,"lX=lY=%d, p_HJ=%1.6f T_HJ=%1.6f p_T2=%1.6f T_T2=%1.6f\n",m,\
		    p_HJ, HJ_TVAL, p_T2, T2_TVAL);
    fprintf(outfil,"lX=lY=%d, p_HJ=%1.6f T_HJ=%1.6f p_T2=%1.6f  T_T2=%1.6f\n",m,\
		    p_HJ, HJ_TVAL, p_T2, T2_TVAL);
  }

  fprintf(stderr,"\n%s does not granger cause %s (UNIF)\n", filename2, 
filename1);
  fprintf(outfil,"\n%s does not granger cause %s (UNIF)\n", filename2, 
filename1);

  for (m=1;m&lt;=Mmax;m++)
  {
    testcaus(y,x,N,epsilon,m,1);

    fprintf(stderr,"lX=lY=%d, p_HJ=%1.6f T_HJ=%1.6f p_T2=%1.6f T_T2=%1.6f\n",m,\
		    p_HJ, HJ_TVAL, p_T2, T2_TVAL);
    fprintf(outfil,"lX=lY=%d, p_HJ=%1.6f T_HJ=%1.6f p_T2=%1.6f  T_T2=%1.6f\n",m,\
		    p_HJ, HJ_TVAL, p_T2, T2_TVAL);
  }

  fclose(outfil);

  return(0);
}

</pre>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
            <div class="bbp-reply-header" id="post-407861">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2014年11月5日 下午4:55
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/407855/#post-407861">
               2 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-407861 -->
            <div class="even bbp-parent-forum-999 bbp-parent-topic-407855 bbp-reply-position-2 user-id-394290 post-407861 reply type-reply status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/394290/" rel="nofollow" title="查看hzmhuai的档案">
               <img src="http://sdn.geekzu.org/avatar/e5f56ab2b4727e9464c56a2c960e4585?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/394290/" rel="nofollow" title="查看hzmhuai的档案">
               hzmhuai
              </a>
              <br/>
              <div class="bbp-author-role">
               普通会员
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               在linux下这样编译g++ -g -Wall -o a a.c。
               <br/>
               在window下我好久不编译了，无可奉告。
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
            <div class="bbp-reply-header" id="post-407862">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2014年11月5日 下午4:56
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/407855/#post-407862">
               3 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-407862 -->
            <div class="odd bbp-parent-forum-999 bbp-parent-topic-407855 bbp-reply-position-3 user-id-394290 post-407862 reply type-reply status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/394290/" rel="nofollow" title="查看hzmhuai的档案">
               <img src="http://sdn.geekzu.org/avatar/e5f56ab2b4727e9464c56a2c960e4585?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/394290/" rel="nofollow" title="查看hzmhuai的档案">
               hzmhuai
              </a>
              <br/>
              <div class="bbp-author-role">
               普通会员
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               上面代码会生成名称为 a的可执行文件
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
            <div class="bbp-reply-header" id="post-407900">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2014年11月6日 下午3:07
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/407855/#post-407900">
               4 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-407900 -->
            <div class="even bbp-parent-forum-999 bbp-parent-topic-407855 bbp-reply-position-4 user-id-109572 topic-author post-407900 reply type-reply status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/109572/" rel="nofollow" title="查看ywh19860616的档案">
               <img src="http://sdn.geekzu.org/avatar/8599115e910c111374c57034b9f33bda?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/109572/" rel="nofollow" title="查看ywh19860616的档案">
               ywh19860616
              </a>
              <br/>
              <div class="bbp-author-role">
               普通会员
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               回复
               <a href="http://cos.name/cn/topic/%e5%a6%82%e4%bd%95%e6%8a%8ac%e8%af%ad%e8%a8%80%e4%bb%a3%e7%a0%81%e7%bc%96%e8%af%91%e4%b8%ba%e5%8f%af%e6%89%a7%e8%a1%8c%e7%9a%84exe%e6%96%87%e4%bb%b6/#post-407861" rel="nofollow">
                2 楼
               </a>
               的
               <a href="http://cos.name/cn/profile/394290/" rel="nofollow">
                hzmhuai
               </a>
               ：
               <br/>
               谢谢您，我现在用Windows系统，linux不会用。
               <br/>
               网上也介绍很多方法，可是没有编译好。比如有用Visual C++的。
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
            <div class="bbp-reply-header" id="post-407904">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2014年11月6日 下午6:42
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/407855/#post-407904">
               5 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-407904 -->
            <div class="odd bbp-parent-forum-999 bbp-parent-topic-407855 bbp-reply-position-5 user-id-375409 post-407904 reply type-reply status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/375409/" rel="nofollow" title="查看zggjtsgzczh的档案">
               <img src="http://sdn.geekzu.org/avatar/79fd3c1e1ddfb0a43ba2d937049e5513?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/375409/" rel="nofollow" title="查看zggjtsgzczh的档案">
               zggjtsgzczh
              </a>
              <br/>
              <div class="bbp-author-role">
               普通会员
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               切换到gcc目录下或添加目录到path变量，然后命令行执行
              </p>
              <pre class="highlight ">gcc -o code.exe code.c
</pre>
              <p>
               不知道你的代码问题还是我的编译器问题，编译返回错误信息。自行调试吧。
              </p>
              <pre class="highlight ">cTest.c: In function 'main':
cTest.c:414:24: error: empty character constant
cTest.c:419:16: error: empty character constant
cTest.c:424:24: error: empty character constant
cTest.c:430:16: error: empty character constant
cTest.c:432:40: error: empty character constant
</pre>
              <p>
               顺便附一份gcc编译说明(不保证版本变更导致的参数变化)：
               <br/>
               ====================
               <br/>
               GCC参数详解
              </p>
              <p>
               [介绍]
               <br/>
               gcc and g++分别是gnu的c &amp; c++编译器
              </p>
              <p>
               gcc/g++在执行编译工作的时候，总共需要4步
              </p>
              <p>
               1.预处理,生成.i的文件
               <br/>
               2.将预处理后的文件不转换成汇编语言,生成文件.s
               <br/>
               3.有汇编变为目标代码(机器代码)生成.o的文件
               <br/>
               4.连接目标代码,生成可执行程序
              </p>
              <p>
               [参数详解]
              </p>
              <p>
               -c
               <br/>
               只激活预处理,编译,和汇编,也就是他只把程序做成obj文件
               <br/>
               例子用法:
               <br/>
               gcc -c hello.c
               <br/>
               他将生成.o的obj文件
               <br/>
               -S
               <br/>
               只激活预处理和编译，就是指把文件编译成为汇编代码。
               <br/>
               例子用法
               <br/>
               gcc -S hello.c
               <br/>
               他将生成.s的汇编代码，你可以用文本编辑器察看
               <br/>
               -E
               <br/>
               只激活预处理,这个不生成文件,你需要把它重定向到一个输出文件里
               <br/>
               面.
               <br/>
               例子用法:
               <br/>
               gcc -E hello.c &gt; pianoapan.txt
               <br/>
               gcc -E hello.c | more
               <br/>
               慢慢看吧,一个hello word 也要与处理成800行的代码
               <br/>
               -o
               <br/>
               制定目标名称,缺省的时候,gcc 编译出来的文件是a.out,很难听,如果
               <br/>
               你和我有同感，改掉它,哈哈
               <br/>
               例子用法
               <br/>
               gcc -o hello.exe hello.c (哦,windows用习惯了)
               <br/>
               gcc -o hello.asm -S hello.c
               <br/>
               -ansi
               <br/>
               关闭gnu c中与ansi c不兼容的特性,激活ansi c的专有特性(包括禁止一
               <br/>
               些asm inline typeof关键字,以及UNIX,vax等预处理宏,
              </p>
              <p>
               -wall
              </p>
              <p>
               显示警告信息
               <br/>
               -fno-asm
               <br/>
               此选项实现ansi选项的功能的一部分，它禁止将asm,inline和typeof用作
               <br/>
               关键字。
               <br/>
               <br/>
               -fno-strict-prototype
               <br/>
               只对g++起作用,使用这个选项,g++将对不带参数的函数,都认为是没有显式
               <br/>
               的对参数的个数和类型说明,而不是没有参数.
               <br/>
               而gcc无论是否使用这个参数,都将对没有带参数的函数,认为城没有显式说
               <br/>
               明的类型
               <br/>
               <br/>
               -fthis-is-varialble
               <br/>
               就是向传统c++看齐,可以使用this当一般变量使用.
               <br/>
               <br/>
               -fcond-mismatch
               <br/>
               允许条件表达式的第二和第三参数类型不匹配,表达式的值将为void类型
               <br/>
               <br/>
               -funsigned-char
               <br/>
               -fno-signed-char
               <br/>
               -fsigned-char
               <br/>
               -fno-unsigned-char
               <br/>
               这四个参数是对char类型进行设置,决定将char类型设置成unsigned char(前
               <br/>
               两个参数)或者 signed char(后两个参数)
              </p>
              <p>
               -include file
               <br/>
               包含某个代码,简单来说,就是便以某个文件,需要另一个文件的时候,就可以
               <br/>
               用它设定,功能就相当于在代码中使用#include
               <br/>
               例子用法:
               <br/>
               gcc hello.c -include /root/pianopan.h
               <br/>
               <br/>
               -imacros file
               <br/>
               将file文件的宏,扩展到gcc/g++的输入文件,宏定义本身并不出现在输入文件
               <br/>
               中
               <br/>
               <br/>
               -Dmacro
               <br/>
               相当于C语言中的#define macro
               <br/>
               <br/>
               -Dmacro=defn
               <br/>
               相当于C语言中的#define macro=defn
               <br/>
               <br/>
               -Umacro
               <br/>
               相当于C语言中的#undef macro
              </p>
              <p>
               -undef
               <br/>
               取消对任何非标准宏的定义
               <br/>
               <br/>
               -Idir
               <br/>
               在你是用#include”file”的时候,gcc/g++会先在当前目录查找你所制定的头
               <br/>
               文件,如果没有找到,他回到缺省的头文件目录找,如果使用-I制定了目录,他
               <br/>
               回先在你所制定的目录查找,然后再按常规的顺序去找.
               <br/>
               对于#include,gcc/g++会到-I制定的目录查找,查找不到,然后将到系
               <br/>
               统的缺省的头文件目录查找
               <br/>
               <br/>
               -I-
               <br/>
               就是取消前一个参数的功能,所以一般在-Idir之后使用
               <br/>
               <br/>
               -idirafter dir
               <br/>
               在-I的目录里面查找失败,讲到这个目录里面查找.
               <br/>
               <br/>
               -iprefix prefix
               <br/>
               -iwithprefix dir
               <br/>
               一般一起使用,当-I的目录查找失败,会到prefix+dir下查找
               <br/>
               <br/>
               -nostdinc
               <br/>
               使编译器不再系统缺省的头文件目录里面找头文件,一般和-I联合使用,明确
               <br/>
               限定头文件的位置
               <br/>
               <br/>
               -nostdin C++
               <br/>
               规定不在g++指定的标准路经中搜索,但仍在其他路径中搜索,.此选项在创建
               <br/>
               libg++库使用
               <br/>
               <br/>
               -C
               <br/>
               在预处理的时候,不删除注释信息,一般和-E使用,有时候分析程序，用这个很
               <br/>
               方便的
               <br/>
               <br/>
               -M
               <br/>
               生成文件关联的信息。包含目标文件所依赖的所有源代码
               <br/>
               你可以用gcc -M hello.c来测试一下，很简单。
               <br/>
               <br/>
               -MM
               <br/>
               和上面的那个一样，但是它将忽略由#include造成的依赖关系。
               <br/>
               <br/>
               -MD
               <br/>
               和-M相同，但是输出将导入到.d的文件里面
               <br/>
               <br/>
               -MMD
               <br/>
               和-MM相同，但是输出将导入到.d的文件里面
               <br/>
               <br/>
               -Wa,option
               <br/>
               此选项传递option给汇编程序;如果option中间有逗号,就将option分成多个选
               <br/>
               项,然后传递给会汇编程序
               <br/>
               <br/>
               -Wl.option
               <br/>
               此选项传递option给连接程序;如果option中间有逗号,就将option分成多个选
               <br/>
               项,然后传递给会连接程序.
               <br/>
              </p>
              <p>
               -llibrary
               <br/>
               制定编译的时候使用的库
               <br/>
               例子用法
               <br/>
               gcc -lcurses hello.c
               <br/>
               使用ncurses库编译程序
               <br/>
               <br/>
               -Ldir
               <br/>
               制定编译的时候，搜索库的路径。比如你自己的库，可以用它制定目录，不然
               <br/>
               编译器将只在标准库的目录找。这个dir就是目录的名称。
               <br/>
               <br/>
               -O0
               <br/>
               -O1
               <br/>
               -O2
               <br/>
               -O3
               <br/>
               编译器的优化选项的4个级别，-O0表示没有优化,-O1为缺省值，-O3优化级别最
               <br/>
               高
               <br/>
               <br/>
               -g
               <br/>
               只是编译器，在编译的时候，产生条是信息。
               <br/>
               <br/>
               -gstabs
               <br/>
               此选项以stabs格式声称调试信息,但是不包括gdb调试信息.
               <br/>
               <br/>
               -gstabs+
               <br/>
               此选项以stabs格式声称调试信息,并且包含仅供gdb使用的额外调试信息.
               <br/>
               <br/>
               -ggdb
               <br/>
               此选项将尽可能的生成gdb的可以使用的调试信息.
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
            <div class="bbp-reply-header" id="post-407919">
             <div class="bbp-meta">
              <span class="bbp-reply-post-date">
               2014年11月7日 上午9:06
              </span>
              <a class="bbp-reply-permalink" href="http://cos.name/cn/topic/407855/#post-407919">
               6 楼
              </a>
              <span class="bbp-admin-links">
              </span>
             </div>
             <!-- .bbp-meta -->
            </div>
            <!-- #post-407919 -->
            <div class="even bbp-parent-forum-999 bbp-parent-topic-407855 bbp-reply-position-6 user-id-109572 topic-author post-407919 reply type-reply status-publish hentry">
             <div class="bbp-reply-author">
              <a class="bbp-author-avatar" href="http://cos.name/cn/profile/109572/" rel="nofollow" title="查看ywh19860616的档案">
               <img src="http://sdn.geekzu.org/avatar/8599115e910c111374c57034b9f33bda?s=80&amp;d=monsterid&amp;r=g"/>
              </a>
              <br/>
              <a class="bbp-author-name" href="http://cos.name/cn/profile/109572/" rel="nofollow" title="查看ywh19860616的档案">
               ywh19860616
              </a>
              <br/>
              <div class="bbp-author-role">
               普通会员
              </div>
             </div>
             <!-- .bbp-reply-author -->
             <div class="bbp-reply-content">
              <p>
               回复
               <a href="http://cos.name/cn/topic/%e5%a6%82%e4%bd%95%e6%8a%8ac%e8%af%ad%e8%a8%80%e4%bb%a3%e7%a0%81%e7%bc%96%e8%af%91%e4%b8%ba%e5%8f%af%e6%89%a7%e8%a1%8c%e7%9a%84exe%e6%96%87%e4%bb%b6/#post-407904" rel="nofollow">
                5 楼
               </a>
               的
               <a href="http://cos.name/cn/profile/375409/" rel="nofollow">
                zggjtsgzczh
               </a>
               ：
               <br/>
               好的，谢谢前辈的指点。
              </p>
             </div>
             <!-- .bbp-reply-content -->
            </div>
            <!-- .reply -->
           </li>
           <!-- .bbp-body -->
           <li class="bbp-footer">
            <div class="bbp-reply-author">
             作者
            </div>
            <div class="bbp-reply-content">
             帖子
            </div>
            <!-- .bbp-reply-content -->
           </li>
           <!-- .bbp-footer -->
          </ul>
          <!-- #topic-407855-replies -->
          <div class="bbp-pagination">
           <div class="bbp-pagination-count">
            查看 6 个帖子 - 1 到 6（总计 6 个）
           </div>
           <div class="bbp-pagination-links">
           </div>
          </div>
          <div class="bbp-no-reply" id="no-reply-407855">
           <div class="bbp-template-notice">
            <p>
             您必须先登录才能回复该主题。
            </p>
           </div>
          </div>
         </div>
        </div>
        <!-- .entry-content -->
        <footer class="entry-meta">
        </footer>
        <!-- .entry-meta -->
       </article>
       <!-- #post -->
       <div class="comments-area" id="comments">
       </div>
       <!-- #comments -->
      </div>
      <!-- #content -->
     </div>
     <!-- #primary -->
     <div class="sidebar-container" id="tertiary" role="complementary">
      <div class="sidebar-inner">
       <div class="widget-area">
        <aside class="widget bbp_widget_login" id="bbp_login_widget-2">
         <h3 class="widget-title">
          登录
         </h3>
         <form action="http://cos.name/cn/wp-login.php" class="bbp-login-form" method="post">
          <fieldset>
           <legend>
            登录
           </legend>
           <div class="bbp-username">
            <label for="user_login">
             用户名:
            </label>
           </div>
           <div class="bbp-password">
            <label for="user_pass">
             密码:
            </label>
           </div>
           <div class="bbp-remember-me">
            <label for="rememberme">
             记住用户名
            </label>
           </div>
           <div class="bbp-submit-wrapper">
            <button class="button submit user-submit" id="user-submit" name="user-submit" tabindex="104" type="submit">
             登录
            </button>
           </div>
           <div class="bbp-login-links">
            <a class="bbp-register-link" href="http://cos.name/cn/wp-login.php?action=register" title="注册">
             注册
            </a>
            <a class="bbp-lostpass-link" href="http://cos.name/cn/wp-login.php?action=lostpassword" title="忘记密码">
             忘记密码
            </a>
           </div>
          </fieldset>
         </form>
        </aside>
        <aside class="widget widget_text" id="text-7">
         <h3 class="widget-title">
          搜索
         </h3>
         <div class="textwidget">
          <form action="http://www.google.com/search" id="bbp-search-form" method="get" onsubmit="Gsitesearch(this)" role="search">
           <div>
           </div>
          </form>
          <form id="bbp-search-form-baidu" onsubmit="g(this)" role="search">
           <div>
           </div>
          </form>
         </div>
        </aside>
        <aside class="widget widget_text" id="text-2">
         <h3 class="widget-title">
          新鲜事
         </h3>
         <div class="textwidget">
          <ul>
           <li>
            <a href="http://cos.name/cn/topics/">
             最新帖子
            </a>
           </li>
           <li>
            <a href="http://cos.name/cn/view/popular/">
             最热门主题
            </a>
           </li>
           <li>
            <a href="http://cos.name/cn/view/no-replies/">
             消灭零回复
            </a>
           </li>
          </ul>
         </div>
        </aside>
        <aside class="widget widget_text" id="text-3">
         <h3 class="widget-title">
          RSS订阅
         </h3>
         <div class="textwidget">
          <ul>
           <li>
            <img src="http://cos.name/wp-includes/images/rss.png"/>
            <a href="http://cos.name/cn/topics/feed/">
             所有主题
            </a>
           </li>
           <li>
            <img src="http://cos.name/wp-includes/images/rss.png"/>
            <a href="http://cos.name/cn/forums/feed/">
             所有帖子
            </a>
           </li>
          </ul>
         </div>
        </aside>
       </div>
       <!-- .widget-area -->
      </div>
      <!-- .sidebar-inner -->
     </div>
     <!-- #tertiary -->
    </div>
    <!-- #main -->
    <footer class="site-footer" id="colophon" role="contentinfo">
     <div class="site-info">
      版权所有 © 2014 统计之都 | 由
      <a href="http://wordpress.org/">
       WordPress
      </a>
      构建 | 主题修改自
      <a href="http://wordpress.org/themes/twentythirteen">
       Twenty Thirteen
      </a>
     </div>
     <!-- .site-info -->
    </footer>
    <!-- #colophon -->
   </div>
   <!-- #page -->
  </div>
 </body>
</html>